package com.demo2;

public class CashReturn extends Cashsuper {
    private double moneyCondtion=0.0d;
    private double moneyReturn=0.0d;

    public CashReturn(double moneyCondtion, double moneyReturn) {
        this.moneyCondtion = moneyCondtion;
        this.moneyReturn = moneyReturn;
    }

    @Override
    public double acceptCash(double money) {
        double result=money;
        if(money>moneyCondtion){
            result=money-Math.floor(money/moneyCondtion)*moneyReturn;
        }
        return result;
    }

    public double getMoneyCondtion() {
        return moneyCondtion;
    }

    public void setMoneyCondtion(double moneyCondtion) {
        this.moneyCondtion = moneyCondtion;
    }

    public double getMoneyReturn() {
        return moneyReturn;
    }

    public void setMoneyReturn(double moneyReturn) {
        this.moneyReturn = moneyReturn;
    }
}
